#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<string>

using namespace std;

int main()
{
	string s;
	getline(cin,s);

	int pos = s.find_last_of(" ");

	cout << s.size() - pos-1 << endl;

	return 0;
}



class Solution {
public:
    string reverseStr(string s, int k) {
        int n = s.size();
        for (int i = 0; i < n; i += 2 * k)
        {
            reverse(s.begin() + i, s.begin() + min(i + k, n));
        }
        return s;
    }
};